public class Main {
    public static void main(String[] args) {
        int h = 9;
        int w = 2 * h - 1;
        int center = w / 2;
        int count = 0;
        int t = 0;
        for (int i = 0; i < h; i++) {
            t = 0;
            for (int j = 0; j < w; j++) {
                if (j < i || j >= w - i) {
                    System.out.print(" ");
                } else {
                    System.out.print(t);
                    if (j + t == w - i - 1) {
                        t -= t >= 0 ? 1 : 0;
                    } else if (j <= w / 2)
                        t += t < i ? 1 : 0;
                }

            }
            System.out.println();
        }
    }
}